rem /**
rem   * fluid - portable application framework
rem   * Copyright (c) 2012-2013, Vikas Burman, all rights reserved.
rem   * 
rem   * Licensed under the terms of the MIT license. You are free to use 'fluid' under any open source or 
rem   * commercial project, as long as this copyright header is left intact.
rem   * 
rem   * An explicit credit notice by using tiny "crafted on fluid" logo, which links back to the commercial site
rem   * of the project, is desired though not bounded by licensing terms.
rem   * 
rem   *     Project: http://fluidjs.codeplex.com/
rem   *     License: http://fluidjs.codeplex.com/license
rem   *        Blog: http://fluidjs.vikasburman.com
rem   * 
rem   *  File: build options setup
rem   *  Dependencies: 
rem   * 	- none
rem   *  Notes:
rem	  * 	- ONE TIME SETTINGS to be done by developer as per development environment
rem   * 
rem   */

rem - ----------------
rem - path definitions
rem - ----------------
rem - place of build options file
set BUILD_OPTIONS=%~dpfx0

rem - define the relative path (from build.bat) to a root folder where "builds" location will be created
rem - build.bat must be kept at "source" root folder
rem - DO NOT USE any type of quotes to enclose path here
set ROOT=..\
rem - ----------------

rem - ----------------------------
rem - environment/tool definitions
rem - ----------------------------
rem - Microsoft Ajax Minifier (http://ajaxmin.codeplex.com/)'s ajaxmin.exe path for minification of js and css 
rem - (IMPORTANT: if this is not defined or does not exists, minification will not be done, instead .debug file
rem - would be used as .min file)
rem - DO NOT USE any type of quotes to enclose file path here
set AJAXMIN=%ProgramFiles(x86)%\Microsoft\Microsoft Ajax Minifier\ajaxmin.exe

rem - define AJAXMIN command line configuration for JS and CSS files
set AJAXMIN_OPTIONS_JS=-js -clobber -analyze -silent -warn:3 -unused:keep -global:$,jQuery,ko,TAFFY,JSON,CryptoJS,deployJava,$f,fluid,fluidOptions,isDefined,isNull,isEmpty,isFunction,isArray,isString,isNumber,isBoolean,isDate,isLiteral
set AJAXMIN_OPTIONS_CSS=-css -clobber -analyze -silent -comments:hacks -colors:hex

rem - if chrome web store hosted app is to be created, define path for chrome.exe, 
rem - (IMPORTANT: if this is not defined, cwsHostedApp.crx will NOT be created although everything else will be 
rem - created for cwsHostedApp)
rem - DO NOT USE any type of quotes to enclose file path here
set CHROME=%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe

rem - browser of choice for opening app
set OPTION_BROWSER=iexplore

rem - switch to open application or folder after build
rem - 0 = No, 1 = Yes
set OPTION_OPEN_AFTER_BUILD=1
rem - ----------------------------


rem - ------------------
rem - customized options
rem - ------------------
rem - define the startup html name
rem - DO NOT DEFINE an extension
set OPTION_STARTUP_HTML_NAME=app

rem - define the app folder name
set OPTION_APP_FOLDER_NAME=app

rem - define the localdata html name
rem - this must be at root of app folder 
rem - DO NOT DEFINE an extension
set OPTION_LOCALDATA_HTML_NAME=localdata

rem - define the offline html name
rem - this must be at root of app folder 
rem - DO NOT DEFINE an extension
set OPTION_OFFLINE_HTML_NAME=offline

rem - define the fav icon file and location
rem - define using / slash as it will go in html
set OPTION_FAV_ICON=%OPTION_APP_FOLDER_NAME%/images/app.ico

rem - define chrome hosted app's icon file and location
rem - define using \ as it will be used in batch file to copy at apt location
set OPTION_CWS_ICON=%OPTION_APP_FOLDER_NAME%\images\icons\app128.png

rem - define the fluid folder name
set OPTION_FLUID_FOLDER_NAME=fluid

rem - define the plugins folder name
set OPTION_PLUGINS_FOLDER_NAME=plugins

rem - on what url(s) online, offline and cws hosted app DEBUG builds are published on localhost
rem - for all these urls a map entry for 127.0.0.1 must be done in host file
rem - host file exists at %systemroot%\system32\drivers\etc\ folder and can be edited as an admin user only
rem - settings for onlineApp
set ONLINE_APP_LOCAL_URL=http://online.fluidApp.com:8080/
set OFFLINE_APP_LOCAL_URL=http://offline.fluidApp.com:8081/
set CWS_HOSTED_APP_LOCAL_URL=http://cwsHosted.fluidApp.com:8082/

rem - file extensions which are supposed to be accessed only via server - these could be
rem - services, html provideres or anything like this. 
rem - listing all such extensions here ensure that these file types will not be copied 
rem - in portableApp build 
rem - format should be .<ext1>;.<ext2>;...;
rem - Not the trailing ; and no spaces in between
set SERVER_ONLY_FILE_TYPES=.asp;.aspx;.jsp;.php;.cgi;.pl;.svc;.asmx;.ascx;.jws;.wsdl;

rem - file extensions which are required only at development time and no need 
rem - to go them in any build
rem - format should be .<ext1>;.<ext2>;...;
rem - Note the trailing ; and no spaces in between
set DEV_ONLY_FILE_TYPES=.sln;.suo;.svn;

rem - file names which are not to be cached in offline mode
set FILES_NOT_TO_CACHE_OFFLINE=%OPTION_STARTUP_HTML_NAME%.html;web.appcache;web.config;mongoose.exe;mongoose.conf;
rem - ------------------

rem - ------------------
rem - build type options
rem - ------------------
rem - what type of builds to be created in case of /D (Debug) build or /R (Release)
rem - in case of all (/A) all builds will be created
rem - 0 = All types, 1 = PortableApp, 2 = OnlineApp, 3 = OfflineApp, 4 = ChromeHostedApp, 5=WrappedApp, 6=PortableServerApp
set OPTION_PRIMARY_BUILD_TYPE=1

rem - which mode (online or offline) to be used for chrome web store hosted app
rem - 0 = OfflineApp, 1 = OnlineApp
set OPTION_CWS_HOSTED_APP_TYPE=0

rem - if dev tools are to be minified
rem - unless you are working on dev tools code, this should be set to 1
rem - 0=No, 1=Yes
set OPTION_MINIFY_DEVTOOLS=0

rem - if rebuild fluid.min.js
rem - unless you are working on the framework code, this must be set to 0
rem - however if value of OPTION_FLUIDJS_CONTENT or any of COMP_XXX  
rem - is changed, this must be set to 1 once, to regenerate framework file,
rem - alternatively, deleting the fluid.debug.js and fluid.min.js files will trigger its
rem - rebuild automatically
rem - 0=No, 1=Yes
set OPTION_REBUILD_FLUIDJS=1

rem - what components to be included in fluid.js file
rem - 0 = All (Full Package) 
rem - 1 = Kernel (Kernel Package)
rem - 2 = Kernel + Core (Core Package)
rem - 3 = Kernel + Core + Pages (Custom Package)
rem - 4 = Kernel + Core + Pages + Code Organization (Custom Package)
rem - 5 = Kernel + Core + Pages + Code Organization + Data (Custom Package)
set OPTION_FLUIDJS_CONTENT=0

rem - if consider COMP_XXX settings in addition to chosen set via OPTION_FLUIDJS_CONTENT
rem - this applies only when OPTION_FLUIDJS_CONTENT is set to anything other than 0 (All)
rem - this considers COMP_XXX settings only to include additional components, all base components
rem - which are supposed to be included with chosen set in OPTION_FLUIDJS_CONTENT will still be
rem - included, even if corrosponding COMP_XXX setting is set to 0
rem - 0=No, 1=Yes
set OPTION_FLUIDJS_CONSIDER_ADDITIONAL_CUSTOM_CONTENT=1

rem - if fluidPlugins list is to be auto-generated
rem - if you have done any custom plugins which are available in \plugins folder
rem - you should set this to 1, else 0
rem - 0=No, 1=Yes
rem - alternatively, if order of loading custom plugins is important, you should set this to 0 and define content
rem - of customizations\fluidPlugins.js file yourself
set OPTION_AUTO_GENERATE_PLUGINS_LIST=0

rem - if local file system access support is not to be deployed
rem - 0=No, FSA.jar applet will be copied and referred in startup html (if required) and framework will be configured accordingly
rem - 1=Yes, FSA.jar applet will NOT be copied and NOT referred in startup html (if required) and framework will be configured accordingly
set OPTION_EXCLUDE_LOCAL_FILE_SYSTEM_SUPPORT=0
rem - ------------------

rem - -------------------------------------
rem - fluid.js components
rem - 0=No (Don't include), 1=Yes (Include)
rem - -------------------------------------
rem - set to 0, in case you are including jQuery via some custom way, but it must be loaded before fluid.js
set COMP_JQUERY=1

rem - will always be treated as 1, irrespective of this setting
set COMP_KERNEL=1

rem - set to 1, if core engine is required (if anything else is added other than kernel, this will automatically be set to 1)
set COMP_CORE=0

rem - set to 1, if framework commands support is required
set COMP_COMMANDS=0

rem - set to 1, if file include support is required
set COMP_FILE_INCLUDE=1

rem - set to 1, if web environment support is required
set COMP_ENV_WEB=1

rem - set to 1, if modules support is required
set COMP_MODULES=0

rem - set to 1, if events support is required
set COMP_EVENTS=0
rem - set to 1, if services support is required
set COMP_SERVICES=0

rem - set to 1, if objects definition support is required
set COMP_OBJECTS=0
rem - set to 1, if dependency injection functionality is required
set COMP_OBJECTS_DI=0

rem - set to 1, if knockout based data binding is required.
set COMP_DATABINDING=0
rem - set to 1, if data object support is required
set COMP_DATAOBJECTS=0
rem - set to 1, if data objects' validation support is required
set COMP_DATAVALIDATION=0
rem - set to 1, if logging support is required
set COMP_LOGGER=0
rem - set to 1, if configuration support is required
set COMP_CONFIG=0
rem - set to 1, if scheduler support is required
set COMP_SCHEDULER=0
rem - set to 1, if workflow support is required
set COMP_WORKFLOW=0
rem - set to 1, if shortcut keys support is required
set COMP_SHORTCUTS=0
rem - set to 1, if AOP support is required
set COMP_AOP=0
rem - set to 1, if cache support is required
set COMP_CACHE=0
rem - set to 1, if html nuggets support is required
set COMP_HTMLNUGGETS=0
rem - set to 1, if i18n support is required
set COMP_I18N=0
rem - set to 1, if communication support is required
set COMP_COMM=0
rem - set to 1, if cookie support is required
set COMP_COOKIE=0

rem - set to 1, if overall security support is required
set COMP_SECURITY=0
rem - set to 1, if authorization functionality of security is required
set COMP_SECURITY_AUTH=0
rem - set to 1, if licensing functionality of security is required
set COMP_SECURITY_LICENSE=0

rem - set to 1, if JS based DB support is required
set COMP_JSDB=0
rem - set to 1, if server side storage option is required for JS based DB
set COMP_JSDB_SERVER=0
rem - set to 1, if dropbox storage option is required for JS based DB
set COMP_JSDB_DROPBOX=0

rem - set to 0, if java applet based file system access is not required
set COMP_IO_FSA=1
rem - set to 1, if FileSystemObject ActiveX based file system access for IE is required
set COMP_IO_FSO=1
rem - set to 1, if UniversalXPConnect based file system access for FireFox v14 or less is required
set COMP_IO_XPCONNECT=0

rem - set to 1, if page and navigation support is required
set COMP_PAGE=0

rem - set to 1, if panes support is required
set COMP_PAGE_MASTER_PAGE=0
rem - set to 1, if panes support is required
set COMP_PAGE_VIEWS=0
rem - set to 1, if panes support is required
set COMP_PAGE_PANES=0
rem - set to 1, if page content zoon support is required
set COMP_PAGE_ZOOM=0
rem - set to 1, if page wizard support is required
set COMP_PAGE_WIZARD=0
rem - set to 1, if breadcrumbs support is required
set COMP_PAGE_BREADCRUMBS=0
rem - set to 1, if page peel corner support is required
set COMP_PAGE_PEELCORNER=0
rem - set to 1, if progressive pagination support is required
set COMP_PAGE_PROGPAGE=0
rem - set to 1, if smoke screen support is required
set COMP_PAGE_SMOKESCR=0
rem - set to 1, if wait wheel support is required
set COMP_PAGE_WAITWHEEL=0
rem - set to 1, if infoBar support is required
set COMP_PAGE_INFOBAR=0
rem - set to 1, if routing support is required
set COMP_PAGE_ROUTES=0
rem - set to 1, if theming support is required
set COMP_PAGE_THEMES=0

rem - set to 1, if conditional callback utility support is required
set COMP_UTILS_CCB=0
rem - -------------------------------------